package com.jdrx.sw.sewage.service;

import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jdrx.sw.sewage.beans.dto.WaterQualityTestTemplateAddDTO;
import com.jdrx.sw.sewage.beans.entity.WaterQualityTestTemplatePO;
import com.jdrx.sw.sewage.dao.WaterQualityTestTemplateDAO;

@Service
public class WaterQualityTestTemplateService {
	@Autowired
	private WaterQualityTestTemplateDAO waterQualityTestTemplateDAO;
	
	public void add(WaterQualityTestTemplateAddDTO dto) {
		WaterQualityTestTemplatePO po = new WaterQualityTestTemplatePO();
		BeanUtils.copyProperties(dto, po);
		waterQualityTestTemplateDAO.insert(po);
	}
	
	public List<WaterQualityTestTemplatePO> list() {
		return waterQualityTestTemplateDAO.listAll();
	}
	
	public void delete(Long id) {
		waterQualityTestTemplateDAO.deleteById(id);
	}
}